
export default {
    namespaced: "LoginStore",
    state: {
        token: "" || localStorage.getItem("token"),
        userInfo: {},
        isLogin: false
    },
    mutations: {
        changeIslogin(state, payload) {
            state.isLogin = payload;
        },
        setToken(state, payload) {
            state.token = payload.token;
            state.userInfo = payload.user;
            // console.log(payload.user);
            // console.log(state.token);
            state.isLogin = true;
        },
        outLogin(state) {
            state.isLogin = false;
            localStorage.clear();
        }
    },

};
